package Eyjafjalla.card.skill;

import Eyjafjalla.action.CloudReflectionAction;
import Eyjafjalla.action.MelodyAction;
import Eyjafjalla.action.RetainCloudAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.card.status.Cloud_Eyjafjalla;
import Eyjafjalla.patch.MelodyPatch;
import Eyjafjalla.subscriber.MelodySubscriber;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

import java.util.ArrayList;

public class SongMary_Eyjafjalla extends AbstractEyjafjallaCard implements MelodySubscriber {
    public static final String ID = "SongMary_Eyjafjalla";
    private static final CardStrings cardStrings;

    public SongMary_Eyjafjalla(){
        super(ID, cardStrings.NAME,-2,cardStrings.DESCRIPTION,CardType.SKILL,CardColor.COLORLESS,CardRarity.SPECIAL,CardTarget.NONE);
    }

    @Override
    public AbstractCard makeCopy() {
        return new SongMary_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new MelodyAction(getSingle()));
    }

    @Override
    public boolean canUpgrade() {
        return !this.upgraded;
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
        }
    }

    @Override
    public void onChoseThisOption() {
        addToBot(new MelodyAction(getSingle()));
    }

    @Override
    public MelodyPatch.MelodySingle getSingle() {
        ArrayList<MelodyPatch.MelodyNote> notes = new ArrayList<>();
        notes.add(new MelodyPatch.MelodyNote(this,0,2,cardStrings.EXTENDED_DESCRIPTION[0]));
        notes.add(new MelodyPatch.MelodyNote(this,1,1,cardStrings.EXTENDED_DESCRIPTION[0]));
        notes.add(new MelodyPatch.MelodyNote(this,2,1,cardStrings.EXTENDED_DESCRIPTION[0]));
        notes.add(new MelodyPatch.MelodyNote(this,3,2,cardStrings.EXTENDED_DESCRIPTION[0]));
        MelodyPatch.MelodySingle single = new MelodyPatch.MelodySingle(name,notes,null);
        return single;
    }

    @Override
    public ArrayList<AbstractGameAction> getNoteActions(boolean isFinal, int specialAmount) {
        return new ArrayList<>();
    }

    @Override
    public int initializeSpecialAmount(boolean isFinal) {
        return 0;
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}
